public class TestSeq {

	public static void main(String[] args) {
		Person p1 = new Person("张三");
		p1.show();
	}

}

/*
 * 创建一个对象的顺序是先创建属性，之后才调用构造函数，最后才是对象的方法调用
 * */
class Person {
	String name;
	Book b1 = new Book(1);
	
	public Person(String name) {
		this.name = name;
		System.out.println("person被创建");
	}
	
	public void show() {
		System.out.println(name+"在读书");
	}
	
	Book b2 = new Book(100);
}

class Book {
	int leaf;
	public Book(int leaf) {
		this.leaf = leaf;
		System.out.println("leaf["+leaf+"]");
	}
}
